Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

Need Explaination

Hi all,

Can any one explain what does the below code?

MakeDate(FYEAR,Mod(ACC+3, 12),'1') as [CalDate],

 

FYear is  2016 in above script

1 Solution

Accepted Solutions
sdmech81
Specialist
Specialist

HI,

MakeDate(FYEAR,Mod(ACC+3, 12),'1') as [CalDate],

I this ACC Is a field,suppose it is 12 then (ACC+3, 12)=15. Then whn we say Mod(ACC+3, 12)/mod(15,12 ) it gives u 3(mod returns remainder i.e 15/12=3 remainder).

When I say

MakeDate(FYEAR,3,'1') then make date function will make a date using passed values and returns: 3/1/2016   as here FYEAR=2016.

Similarly try to interpret rest o them..

Because they all r using some function on make date.

For example if I say:

=num(MonthName(MakeDate(2016,3,'1'))) will return a number :42430   its as good as saying =num(MonthName(3/1/2016)))

and

=Text(MonthName(MakeDate(2016,3,'1')))   will give u date in text format like:  Mar 2016

Just try to work out the functions ontop of makedate ..

Hope this helps

View solution in original post

10 Replies
Anil_Babu_Samineni

I assume, Here ACC is nothing but Value

So finally i will do my best to explain

Mod(ACC+3,12) Will return Value

Ex: ACC is 10 -- Mod(10+3,12) -- Mod(13,12) Will return 1 // Because, We are dividing 13/12 - Here it remains 1 that's Mod will function do

MakeDate(FYEAR, Mod(ACC+3,12),'1') as [CalDate]

Here, the function acting as MakeDate -- MakeDate(YYYY [ , MM [ , DD ] ])

MakeDate(2013, 12, 1) it store like 2013,12,1 on CalDate

and then MonthName is nothing but Dec 2013

Text will turn as Text only

Num will changed to Number function like '41609'

I don't know what are the gg, rr, tt here. You may explore more on this part

HTH

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
soniasweety
Master
Master
Author

Thanks anil for clear explanation.

here Acc  field values are   2,3,4

and     gg&rr&tt&  these are field names.

sdmech81
Specialist
Specialist

HI,

MakeDate(FYEAR,Mod(ACC+3, 12),'1') as [CalDate],

I this ACC Is a field,suppose it is 12 then (ACC+3, 12)=15. Then whn we say Mod(ACC+3, 12)/mod(15,12 ) it gives u 3(mod returns remainder i.e 15/12=3 remainder).

When I say

MakeDate(FYEAR,3,'1') then make date function will make a date using passed values and returns: 3/1/2016   as here FYEAR=2016.

Similarly try to interpret rest o them..

Because they all r using some function on make date.

For example if I say:

=num(MonthName(MakeDate(2016,3,'1'))) will return a number :42430   its as good as saying =num(MonthName(3/1/2016)))

and

=Text(MonthName(MakeDate(2016,3,'1')))   will give u date in text format like:  Mar 2016

Just try to work out the functions ontop of makedate ..

Hope this helps

View solution in original post

soniasweety
Master
Master
Author

Nice to read   Great

Thank you so much. its very clear

sdmech81
Specialist
Specialist

and for last one:

gg&rr&tt&MonthName(MakeDate(FYEAR,Mod(ACC+3, 12),'1'))

I think gg ,rr are all fileds in data model so fr example if I say

='sachin ' & MonthName(MakeDate(2016,3,'1'))  then it ll return:   sachin Mar 2016

so in ur case in place of sachin it will take values from gg and rr n so on

Sachin

hector_munoz
Specialist
Specialist

Hi Sony,

MakeDate(FYEAR,Mod(ACC+3, 12),'1') as [CalDate]  -> Creates a field called 'CalDate' with a date with 1 as day, with a month 3 months later than ACC and FYEAR as a year.

MonthName(MakeDate(FYEAR,Mod(ACC+3, 12),'1')) as [MName]  -> Creates a field called 'MName' with a month name (jan, feb, mar, ..., dec) with 1 as day, with a month 3 months later than ACC and FYEAR as a year.

Text(MonthName(MakeDate(FYEAR,Mod(ACC+3, 12),'1'))) as [M Text]  -> Creates a field called 'M Text' with a month name (january, february, march, ..., december) with 1 as day, with a month 3 months later than ACC and FYEAR as a year.

num(MonthName(MakeDate(FYEAR,Mod(ACC+3, 12),'1'))) as MNo  -> Creates a field called 'MNo' with a month number (1, 2, 3, ..., 12) with 1 as day, with a month 3 months later than ACC and FYEAR as a year.

gg&rr&tt&MonthName(MakeDate(FYEAR,Mod(ACC+3, 12),'1')) as _Main  -> Creates a field called '_Main' with a combination of fields gg + rr + tt + month name (jan, feb, mar, ..., dec) with 1 as day, with a month 3 months later than ACC and FYEAR as a year.

Regards,
H

soniasweety
Master
Master
Author

Thank you all for your Quick response.

soniasweety
Master
Master
Author

Hi sachin,

in bTW  how below working with variable ?

Means there is operator between variable and sum   so how it is taking?

=Sum({<Product={'laptop'}>} $(vsales))

sdmech81
Specialist
Specialist

R u talking about = ??

It says Give me a sum of sales(ur sales data is stored in variable vsales) where product should be laptop..

gt?

Sachin