Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

cskqlikview
New Contributor II

i have the following expression working fine in Qlikview but not in Qsense

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)

Tags (1)
5 Replies

Re: i have the following expression working fine in Qlikview but not in Qsense

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)

cskqlikview
New Contributor II

Re: i have the following expression working fine in Qlikview but not in Qsense

the above expression working correctly in Qlikview but not working in QlikSense. 

cskqlikview
New Contributor II

Re: i have the following expression working fine in Qlikview but not in Qsense

I will try to put bracket as you mentioned.

Re: i have the following expression working fine in Qlikview but not in Qsense

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?

cskqlikview
New Contributor II

Re: i have the following expression working fine in Qlikview but not in Qsense

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?

Community Browser