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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
nareshthavidishetty
Creator III
Creator III

data generation

hi all ,

can anyone tell me how to generate data think that I'm not having any source files

my requirement is lik generate data ,date,sunnydays such that atleast 40% days are sunnyin the year

autogenrate function I tried and generated date but not sunny days how can I generate data

Labels (1)
5 Replies
sunny_talwar
MVP
MVP

Something like this?

Table:

LOAD Date(MakeDate(2014, 12, 31) + IterNo()) as Date,

  If(Rand() <= 0.40, 'Sunny Days', 'Cloudy Days') as DayTypeFlag

AutoGenerate 1

While IterNo() <= MakeDate(2015, 12, 31) - MakeDate(2014, 12, 31);

nareshthavidishetty
Creator III
Creator III
Author

I tried ur logic not working

LOAD
//RecNo() as S.no,

Date(MakeDate(2015,12,31)+recno()) as Date,
if(Rand()<=0.8,'Y','N') as sunny days

autogenerate 365

I couldn't understand this steps below

AutoGenerate 1

While IterNo() <= MakeDate(2015, 12, 31) - MakeDate(2014, 12, 31);



sunny_talwar
MVP
MVP

So this did not work? or did it?

LOAD
//RecNo() as S.no,

Date(MakeDate(2015,12,31)+recno()) as Date,
if(Rand()<=0.8,'Y','N') as sunny days

autogenerate 365

nareshthavidishetty
Creator III
Creator III
Author

‌not working

sunny_talwar
MVP
MVP

Does this not look right?

Capture.PNG

79.45% are Yes and 20.55% are No?