Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
LOAD
[YEAR]*10000000000 + CEIL([MONTH]/6)*100000000 + CEIL([MONTH]/3)*1000000 + [MONTH]* 10000 + [WEEK] * 100 + DAY(IF([MONTH] = 01 AND [WEEK] > 05, WEEKEND(MAKEDATE([YEAR], [MONTH])), IF([MONTH] = 12 AND [WEEK] = 01, MONTHEND(MAKEDATE([YEAR], [MONTH])), IF(WEEKEND(MAKEWEEKDATE([YEAR], [WEEK])) > MONTHEND(MAKEDATE([YEAR], [MONTH])), MONTHEND(MAKEDATE([YEAR], [MONTH])), WEEKEND(MAKEWEEKDATE([YEAR], [WEEK])))))) AS [PERIOD_DATE_ID]
FROM [$(vFileName)] (qvd)
What you meant not working fine here?
May be you can put the Mutiply in to braces, thats a good practice always
([YEAR]*10000000000) + (CEIL([MONTH]/6)*100000000) + (CEIL([MONTH]/3)*1000000) + ([MONTH]* 10000) + ([WEEK] * 100)
the above expression working correctly in Qlikview but not working in QlikSense.
I will try to put bracket as you mentioned.
With the word Working and not Working, we can't help you out. Give us a little more information How and Why?
What is happening weird in QlikSense compare to QlikView for this script?
In Qlikview the given expression computing the results as expected using the "YEAR" , "MONTH" and "WEEK" field from the table. In case of QlikSense the expression giving the null results for the same set of Data. I changed the expression as follows in Qliksense and now its giving the results and the results are matching.
NUM#(YEAR,'0.0')*10000000000 + CEIL(NUM#(MONTH,'0.0')/6)*100000000 + CEIL(NUM#(MONTH,'0.0')/3)*1000000 + NUM#(MONTH,'0.0')* 10000 + NUM#(WEEK,'0.0') * 100 + DAY(IF([MONTH] = 01 AND [WEEK] > 05, WEEKEND(MAKEDATE(NUM#(YEAR,'0.0'), NUM#(MONTH,'0.0'))),IF([MONTH] = 12 AND [WEEK] = 01, MONTHEND(MAKEDATE(NUM#(YEAR,'0.0'), NUM#(MONTH,'0.0'))), IF(WEEKEND(MAKEWEEKDATE(NUM#(YEAR,'0.0'), NUM#(WEEK,'0.0'))) > MONTHEND(MAKEDATE(NUM#(YEAR,'0.0'), NUM#(MONTH,'0.0'))), MONTHEND(MAKEDATE(NUM#(YEAR,'0.0'), NUM#(MONTH,'0.0'))), WEEKEND(MAKEWEEKDATE(NUM#(YEAR,'0.0'), NUM#(WEEK,'0.0')))))))
Is there any other alternative?