Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am very new to qlikview and just started exploring few concept.i come across below scenario. it will be helpful if i get any solution
i want display same text field values into 2 fields for current month and previous month in straight table or any chart and compare whether the text is matching or not
what i want is how to show the same text field values for current and previous month in two column as below
my data is below
AML|High|2021-06-30
AML|Medium|2021-05-31
AML|Low|2021-04-30
AML|VeryLow|2021-03-31
i want to display previous month text value in Previous Month <text field>|
Name|Current month <text field> | Previous Month <text field>|Businessdate
AML|High|Medium|2021-06-30
AML|Medium|Low|2021-05-31
AML|Low|Very Low|2021-04-30
i want to display previous month text (Medium or High) values in previous Month <text field> field
This script might help started.
SOURCE:
LOAD * inline [
Name,CurrentMonth,BusinessDate
AML,High,2021-06-30
AML,Medium,2021-05-31
AML,Low,2021-04-30
AML,VeryLow,2021-03-31];
Final:
LOAD Name, CurrentMonth, BusinessDate,
peek(CurrentMonth) as PreviousMonth,
peek(BusinessDate) as PreviousBusinessDate
Resident SOURCE
ORDER BY Name, BusinessDate asc
;
Drop table SOURCE;
Hi Vegar,
Thanks for the help. its working !!!
When i Add more dataset , peek function doesnt produde correct result .
AML,High,2021-06-30
AML,Medium,2021-05-31
AML,Low,2021-04-30
AML,VeryLow,2021-03-31
CFT,High,2021-06-30
CFT,Medium,2021-05-31
CFT,Low,2021-04-30
My output shows as below
AML|High|Medium|2021-06-30|2021-05-31
AML|Medium|Low|2021-05-31|2021-04-30
AML|Low|Very Low|2021-04-30|2021-03-31
aml|Very Low| - | 2021-03-31| -
CFT|High|Medium|2021-06-30|2021-05-31
CFT|Medium|Low|2021-05-31|2021-04-30
CFT|Low|High|2021-04-30|2021-06-30 -- By right highlighted filed should be null (no prev month (march) data to compare, instead its comparing april with june month