Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Urgent Pls Help me out

Hi,

Can Anyone Help me on below Expression Please do the needful????

Kindly help me how to compare two date:

----------------------------------------------------------------------------------------------------------------------

Example:

let vCurrMonthYear=MonthName(Today());


LOAD RES_ID,
     RES_NAME,
     month(Date) as MonthName

FROM 
(biff, embedded labels, table is Sheet1$);

IF(vMonth=MonthName) then

  

STORE ResourceFile INTO E:\ResourceFile.qvd (QVD);

Else


STORE ResourceFile INTO E:\Resourcee.qvd (QVD);

Endif

----------------------------------------------------------------------------------------------------------------------

After compare vMonth=MonthName, MonthName giving me Null Values.

in Monthname not carry value.

Kindly help me.

Regards

Ravi

Labels (1)
9 Replies
Not applicable
Author

Hi Ravi,

If you call a variable, use following syntax for the variable: $(vMonth).

Your expression (comparison) would then be

     IF $(vMonth) = MonthName THEN ...

Hope this helps you further.

Regards,

sebablum

beunderf
Partner - Creator II
Partner - Creator II

Could you sent an example of your Date.xls?

Not applicable
Author

First, it is not possible to simply get the value of 'MonthName' like this.

As it is a column name, in the loading script, it must return NULL in MonthName.

I think what you try to do is to split the data into two files.

So, I think you should use two tables to keep the data using 'where'

sivarajs
Specialist II
Specialist II

Whats your vMonth variable holds???

Sivaraj S

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Can you explain what your trying to do here by comparing dates?What value vMonth variable has?

Celambarasan

Not applicable
Author

Hello Friends,

I am comparing both loaded data field  MonthName and Current Month Name.

Only I comparing both date.

Can you Please help me out??

Regards

Ravi Gupta

sivarajs
Specialist II
Specialist II

can you check this

let vmonth=month(today());

if('$(vmonth)=monthname')

Sivaraj S

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Check with this approach.

let vCurrMonthYear=MonthName(Today());

ResourceFile:
LOAD RES_ID,
     RES_NAME,
     month(Date) as MonthName

FROM 
(biff, embedded labels, table is Sheet1$) where month(Date) = vCurrMonthYear;

 

STORE ResourceFile INTO E:\ResourceFile.qvd (QVD);

Drop Table ResourceFile;

Resourcee:
LOAD RES_ID,
     RES_NAME,
     month(Date) as MonthName

FROM 
(biff, embedded labels, table is Sheet1$) where month(Date) <> vCurrMonthYear;


STORE Resourcee INTO E:\Resourcee.qvd (QVD);

Drop Table Resourcee;

Hope this your need

Celambarasan

Not applicable
Author

Celambarasan is correct.

I believe it is what you need.