Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

rsundarraj
New Contributor III

Variable for Days

  • M_date  is avaiable where I need formulae M_date for a Delivered Product Vz Incorrect Product.
  • Here I have to use the days not the months.The days start from current date (Today)
  • actual month = last 30 days(variable which suits the Formulae)
  • month before = last 30 days to last 60 days(variable which suits the Formulae)
11 Replies

Re: Variable for Days

So what is your question?

Can you give a better description of what you are trying to achieve?

Re: Variable for Days

I have no idea what you're trying to say. If you have a question you'll have to ask it a bit more clearly.


talk is cheap, supply exceeds demand
rsundarraj
New Contributor III

Re: Variable for Days

I want to form a KPI metrics(UI Design) .I have Manufaturing date / Delivered product / Incorrect product.

I have to calculate actual month = last 30 days and also actual month = last 30 days ... can any one of you can provide me the formulae or set analysis for the same

rsundarraj
New Contributor III

Re: Variable for Days

for Ex..

=((sum({<[Manufacturing year]={$(vCurrentYear)}, [Manufacturing month]={$(=vCurrentmonth),$(=vLastmonth)}>}[Incorrect Quantity])/sum({< [Manufacturing year]={$(vCurrentYear)},[Manufacturing month]={$(=vCurrentmonth),$(=vLastmonth)}>}(PosMenge))*1000000

/(sum({< [Manufacturing year]={$(vCurrentYear)},[Manufacturing month]={$(=vLastbeforemonth)}>}[Incorrect Quantity])/sum({< [Manufacturing year]={$(vCurrentYear)},[Manufacturing month]={$(=vLastbeforemonth)}>}(PosMenge))*1000000))*100)-100&'%'

I need previous 30 days instead of months ..

Re: Variable for Days

The actual month is August: Month(Today())


talk is cheap, supply exceeds demand

Re: Variable for Days

You can replace  below piece of set analysis in your expression

[Manufacturing date]={">=$(=date(max([Manufacturing date])-30)"}

Remove [Manufacturing year]={$(vCurrentYear)}, [Manufacturing month]={$(=vCurrentmonth),$(=vLastmonth)}

rsundarraj
New Contributor III

Re: Variable for Days

Hi Kush,

Thanks for the first one

can you please provide me the 2. month before = last 30 days to last 60 days

MVP
MVP

Re: Variable for Days

HI,

Try like this

[Manufacturing date]={">=$(=date(max([Manufacturing date])-60)<=$(=date(max([Manufacturing date])-31)"}


Hope this helps you.


Regards,

jagan.

Re: Variable for Days

try below set expression

=Sum({<[Manufacturing date]={">=$(=date(max([Manufacturing date])-60))<=$(=date(max([Manufacturing date])-31))"},[Manufacturing year]=,[Manufacturing month]=>}PosMenge)

Community Browser