Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
just start with Qlik and I have my first question. I've been looking around but I did not found a suitable solution.
With a bucle I need to read all row in Table 1, for different Date I need to sum the values if same conditions are meet.
1st : if table 1. column A = N then it has to sum the value in column D without check column C
2nd: if table 1 column A is NULL then get the data from column C and sum he column D by text
I put an example:
this table (Table 1) is my actual table:
Date | column A | Column C | Column D |
10/01/2019 | CMDEP | 0,33 | |
10/01/2019 | CMDEP | 0,67 | |
10/01/2019 | CMDEP | 1 | |
10/01/2019 | CMDEP | 4,33 | |
10/01/2019 | CMDEV | 0,33 | |
10/01/2019 | CMDEP | 1,33 | |
10/01/2019 | CMDEP | 1,67 | |
10/01/2019 | z | CMDEZ | 3 |
10/01/2019 | N | CMDEN | 8 |
10/01/2019 | CMDEP | 3 | |
10/01/2019 | CMIEP | 4 | |
10/01/2019 | CMIEN | 1 | |
10/01/2019 | CMIEP | 4 | |
11/01/2019 | CMDEP | 6 | |
11/01/2019 | CMDEP | 9 | |
11/01/2019 | CMDEP | 8 | |
11/01/2019 | CMDEP | 6 | |
11/01/2019 | CMDEV | 3 | |
11/01/2019 | CMDEP | 4 | |
11/01/2019 | CMDEP | 2 | |
11/01/2019 | CMDEP | 0,6 | |
11/01/2019 | CMIEP | 5 | |
11/01/2019 | CMIEN | 11 | |
11/01/2019 | CMIEP | 3 | |
11/01/2019 | z | CMDEZ | 6 |
11/01/2019 | N | CMDEN | 9 |
(Table 2): below the final result
Data | CMDEP | CMDEV | CMIEP | z | N |
10/01/2019 | 12,33 | 0,33 | 8 | 3 | 8 |
11/01/2019 | 35,6 | 3 | 8 | 6 | 9 |
I hope to have explain my problem correctly,
thanks in advantage for your help.
I understand. If you want to make a crosstable in the script from your
table then you can use generic load.
Check out @hic Qlik design blog post from 2014, it is still a
good read.
https://community.qlik.com/t5/Qlik-Design-Blog/The-Generic-Load/ba-p/1473470
I created the pivot table below by using the following script:
Data: LOAD Date, if(len(trim([column A]))>0, [column A] , [Column C]) as Dimension,
replace([Column D],',','.') as [Value] FROM [https://community.qlik.com/t5/QlikView-App-Development/loop-with-multiple-condition/m-p/1554548#M440560] (html, codepage is 1252, embedded labels, table is @1);
HI Vegar,
Thanks a lot, this is a nice solution, but the result is from the Table dialague is
I need to have the final table with the script
I understand. If you want to make a crosstable in the script from your
table then you can use generic load.
Check out @hic Qlik design blog post from 2014, it is still a
good read.
https://community.qlik.com/t5/Qlik-Design-Blog/The-Generic-Load/ba-p/1473470
HI,
yes, it help my a lot,
thanks again for your hepl
regards