MS SQL PIVOT with text as Fieldtype
The trick is, that you cast the text/string into varchar and then you can use MAX as aggregation type to return the readable value.
Read More →The trick is, that you cast the text/string into varchar and then you can use MAX as aggregation type to return the readable value.
Read More →Temporary Entity Tables build with DAX Query and using the CRM Tables: StringMapBase MetadataSchema.Entity
Read More →Generating a calender was a very important task within qlik sense/view – so even as the date functions within power query or dax are awesome, I still prefer to have an “inbuild” calender. To achieve this goal, you can switch to the “Modeling” view -> add a “Table” and then just copy and paste the […]
Read More →From time to time it’s needed to loop over the rows of a master table – e.g. different companies within your organisation are stored within different databases. So to avoid creating “long” SQL-scripts where you just change the db information, you can ease it up by:
Read More →Usecase Imagine you have a customer who wants to split revenue by multiple dimensions not based upon total figures nor on percentual splits. E.g. you plan 10k and split it to 3 Segments by 20% Seg A 40% Seg B 40% Seg C And after this by ProductGroup and Product which are in one Dimension […]
Read More →Usecase Sometimes it´s needed that a user can add elements to a dimension without accessing the modeller – e.g. you wanna budget personal ressources and want to allow power users to add new placeholders to the employee dimension. To get this working, you can use multiple ways on how to pass values from the worksheet, […]
Read More →Ausgangslage Der Kunde liefert eine Wertetabelle, bei der in einer der Spalten XML-Daten ohne feste Struktur vorhanden sind. Diese sollen so aufbereitet werden, dass diese Struktur als eigene Felder im Datenmodel aufscheinen. Tabelle: id Attribute Attributevalue FromDate 1 1 <Attr1>123</Attr1><name>Test</name> 42005 2 2 <price>10.50</price> 41911 Vorgehen Daten ergänzen <root> node Tabelle in XML Textdatei exportieren […]
Read More →Nutzen Sie möchten Ihren Nutzern eine einfache Möglichkeit zur Verfügung stellen, damit diese via Comboboxen und Button die Werte aus einer Sicht (bei Version) in eine andere Sicht (Version) kopieren können. Bsp. Saisonalität Die Saisonalität wird in einem Hilfswürfel gespeichert: <<saison_koart>> Enthalten sind die folgenden Dimensionen: Jahr Monat Version Saison_Typ (linear, effektiv oder prozentual) _measure_saison […]
Read More →To backup your jedox linux installation, you can use the following script. Pls. change Folders to match your local Jedox Installation:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# Programm: jedox_backup.sh # Autor : Philipp Frenzel <frp@informatec.com> # # Inhalt : # 1. Jedox stoppen # 2. Sicherung der Jedoxdaten (/mnt/data/Jedox/Data) und Anlegen einer Logfile als Tagessicherung / Vollsicherung am Montag und dann inkrementelle Sicherung am Di, Mi, Do, Fr. # 3. Jedox starten # 4. Aufraeumen: Logfiles, älter als 90 Tage, werden gelöscht/Backups älter 14 Tage werden gelöscht # Datum : 23./29.10.2015 # Aenderung: 05.02.2016: Aufraeumem erweitert - Backups aelter 14 Tage werden gelöscht; Aufraeumen nur Montags # 15.02.2016: .archived Dateien werden Montags geloescht; # 22.02.2016: Aenderung der Eigentumerrechte, einmal Eigentuemer root für das Backup und dann wieder zurueckgeben an jedoxweb # 10.10.2016: log-Aenderungen eingeführt, eigenes log für den olap Server unter Data. # Funktionen: sende_mail(){ echo "$2" | mailx -S smtp=server:port -s "$1" -v frp@informatec.com } # Variablen DATUM=$(date +"%Y%m%d") INSTALLPFAD=/mnt/data/Jedox OBJECTSPFAD=/mnt/data/Jedox/Data SOURCE="" BACKUP_DIR=${OBJECTSPFAD}/../../Backup LOGFILE=${OBJECTSPFAD}/../../Backup/Logdateien/Backuplog_${HOSTNAME}_${DATUM}.log WOCHENTAG=$(date +"%u") RC=0 #check User if [ `id -un` != "root" ] then echo "User ungueltig, benoetigt wird root" sende_mail "Probleme beim Backup auf der $HOST" "User ungueltig, benoetigt wird root" exit 1 fi echo $(date +"%H:%M:%S")": START - Jedox stoppen ----------------------------------------" >> ${LOGFILE} sudo ${INSTALLPFAD}/jedox-suite.sh stop >> ${LOGFILE} wait $(pgrep palo) echo "Backup ${HOSTNAME} vom $(date +"%d.%m.%Y-%H:%M")----------------------------------------" >> ${LOGFILE} cd ${OBJECTSPFAD} RC=$? #Prüfen, ob Ordner da ist - wenn dann ist $? gleich 0 if [[ $RC -ge 1 ]]; then echo "Pfad nicht gefunden. Backup nicht ausgefuehrt!" >> ${LOGFILE} sende_mail "Probleme beim Backup auf der ${HOSTNAME}" "Bitte die Logdatei des Backups ueberpruefen: ${LOGFILE}" #echo "Bitte die Logdatei des Backups ueberpruefen: ${LOGFILE}" | mailx -S smtp=smtprelay1.s-v.loc:25 -s "Probleme beim Backup auf der ${HOSTNAME}" -v $MAILEMPFAENGER exit 8 fi # Backup echo $(date +"%H:%M:%S")": Beginn der Sicherung" >> ${LOGFILE} #root die Eigentuemerrechte geben, damit er das Backup auch komplett ausfuehren kann sudo chown -R root /mnt/data/Jedox/Data/ #gucken, ob Montag ist if [[ ${WOCHENTAG} == 1 ]]; then FILENAME=${BACKUP_DIR}/Backup_${HOSTNAME}_${DATUM}.${WOCHENTAG} echo "Vollbackup: ${FILENAME}.tar" >> ${LOGFILE} #snapshot Datei wird gelöscht rm ${BACKUP_DIR}/usr.snar tar -vcz --file=${FILENAME}.tar.gz --listed-incremental=${BACKUP_DIR}/usr.snar ${SOURCE} >> ${LOGFILE} elif [[ ${WOCHENTAG} -ge 2 && ${WOCHENTAG} -le 5 ]]; then SDATUM=$(date -d "last Monday" +"%Y%m%d") FILENAME=${BACKUP_DIR}/Backup_${HOSTNAME}_${SDATUM}.${WOCHENTAG} echo "inkrementelles Backup: ${FILENAME}.tar" >> ${LOGFILE} tar -vcz --file=${FILENAME}.tar.gz --listed-incremental=${BACKUP_DIR}/usr.snar ${SOURCE} >> ${LOGFILE} #tar -vcf ${BACKUP_DIR}/Backup_${HOSTNAME}_${DATUM}.tar ${SOURCE} >> ${LOGFILE} fi RC=$? #Prüfen ob Kompression ohne Fehler if [[ $RC -ge 1 ]]; then rm ${FILENAME}.tar echo $(date +"%H:%M:%S")": Tar nicht korrekt erstellt. Backup von ${HOSTNAME} wird nicht ausgefuehrt!" >> ${LOGFILE} sende_mail "Probleme beim Backup auf der ${HOSTNAME}" "Bitte die Logdatei des Backups ueberpruefen: ${LOGFILE}" exit 8 else echo "$(date +"%H:%M:%S"): tar und compress erfolgreich." >> ${LOGFILE} # echo "$(date +"%H:%M:%S"): TAR erfolgreich. Beginn Compress" >> ${LOGFILE} # gzip ${FILENAME}.tar # RC=$? # #Prüfen ob Kompression ohne Fehler # if [ $RC -ge 1 ]; # then # rm ${FILENAME}.tar.gz # echo "RC: $RC bei Compress " >> ${LOGFILE} # echo $(date +"%H:%M:%S")": Compress nicht erfolgreich. Backup ueberpruefen!" >> ${LOGFILE} # sende_mail "Probleme beim Backup auf der ${HOSTNAME}" "Bitte die Logdatei des Backups ueberpruefen: ${LOGFILE}" # # else echo $(date +"%H:%M:%S")": Backup von ${HOSTNAME} wurde korrekt ausgefuehrt!" >> ${LOGFILE} #fi fi # zum unterbrechen # read -p "Press [Enter] key to delete files..." # Nachträgliche Aufräumarbeiten; immer Montags if [[ ${WOCHENTAG} == 1 ]]; then echo $(date +"%H:%M:%S") "Aufraeumen - folgende Dateien werden geloescht:" >> ${LOGFILE} #Logfiles, älter 90 Tage löschen find /mnt/data/Backup/Logdateien/ -type f -mtime +91 -exec ls {} \; >> ${LOGFILE} find /mnt/data/Backup/Logdateien/ -type f -mtime +91 -delete 2>> ${LOGFILE} #Sicherungsdateien, älter 14 Tage löschen find /mnt/data/Backup/Backup_lxkad* -type f -mtime +14 -exec ls {} \; >> ${LOGFILE} find /mnt/data/Backup/Backup_lxkad* -type f -mtime +14 -delete 2>> ${LOGFILE} #.archived-Dateien löschen find /mnt/data/Jedox/Data/ -name '*.archived' -type f -exec ls {} \; >> ${LOGFILE} find /mnt/data/Jedox/Data/ -name '*.archived' -type f -delete 2>> ${LOGFILE} fi # zum unterbrechen # read -p "Press [Enter] key to start Jedox..." #jedoxweb die Eigentuemerrechte zurueckgeben, sudo chown -R jedoxweb /mnt/data/Jedox/Data/ echo $(date +"%H:%M:%S")": Jedox starten ----------------------------------------" >> ${LOGFILE} #sudo ${INSTALLPFAD}/jedox-suite.sh start >> ${LOGFILE} sudo ${INSTALLPFAD}/jedox-suite.sh start >> ${INSTALLPFAD}/log/olap_server.log # eine Schleife, die 300 Sekunden lang prüft, ob die Dienste gestartet wurden z=(0); while [[ $z -lt 300 ]]; do # Abfrage, ob die Jedox Dienste gestartet wurden if pgrep "palo" && pgrep "core.bin" && pgrep "java" && pgrep -U jedoxweb "httpd"; then echo $(date +"%H:%M:%S") "Alle Prozesse laufen - Jedox ordnungsgemaess gestartet!" >> ${LOGFILE} break; fi sleep 30; z=`expr $z + 30`; done; # Prüfung ob alle Dienste gestartet sind, falls nicht eine Benachrichtigung... if ! pgrep "palo" || ! pgrep "core.bin" || ! pgrep "java" || ! pgrep -U jedoxweb "httpd"; then sende_mail "Probleme beim Backup auf der ${HOSTNAME}" "Jedox wurde nicht ordentlich gestartet. Bitte pruefen." fi echo $(date +"%H:%M:%S") "Backup ENDE!" >> ${LOGFILE} exit $RC |
Read More →